#ifndef VIDEOCAPTURETASK_H
#define VIDEOCAPTURETASK_H
#include "Receive_handler.h"
#include "Task_Base/Task_Base.h"
#include "CameraCaptureIterface.h"
#include <list>
class CameraCaptureImpl;
class CCriticalSection;
class VideoCapureOut;
class VideoCaptureTask: public Task_Base,public Receive_handler,CameraCaptureIterface
{
public:
    VideoCaptureTask();
    ~VideoCaptureTask();
public:
    int		Width();
    int		Hight();
public:
    int  get_camera_list(std::list<std::string> &sList);
    int  get_camera_info_list(const std::string &camera_name, std::list<std::string> &listInfo);

    void    set_capture(VideoCapureOut *pVideoCapureOut);
    bool    Init(const std::string &camera_name,const std::string &info,Receive_handler*);
    virtual int close();
public:
    virtual bool receive_handler(const char *data,int size);
    virtual void receive_data(const char *data, int len);//
protected:
    virtual int svc();
private:
     Receive_handler        *m_pHandler;
     CameraCaptureImpl      *m_oCameraCapture;
     CCriticalSection       *m_oYuvCCriticalSection;
     std::string             m_oYuvBuf;
     VideoCapureOut         *m_oVideoCapureOut;
};

#endif // VIDEOCAPTURETASK_H
